;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;  DragonballTypes
;  script file for PalmDebugger
;
;  This file should have any useful macros for the debugger.
;  Examples of this are structures for the register maps in 
;  the processors, the globals, and other data formats.
;
;  History
;  Creator and origin unknown
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; These MPW script lines will do most of the work of converting
;   a C Structure type to Debugger format
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;find 
;replace  -c  /([A-Za-z]+)2[ t]+([_a-zA-Z0-9[]-]+)1;/ "> 2 "1""
;find 
;replace -c  //// ""
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; DragonBall definitions
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
typedef struct "HwrDBallCSType"
	> UInt16 "csAGroupBase"
	> UInt16 "csBGroupBase"
	> UInt16 "csCGroupBase"
	> UInt16 "csDGroupBase"
	
	> UInt16 "csAGroupMask"
	> UInt16 "csBGroupMask"
	> UInt16 "csCGroupMask"
	> UInt16 "csDGroupMask"
	
	> UInt32 "csASelect0"
	> UInt32 "csASelect1"
	> UInt32 "csASelect2"
	> UInt32 "csASelect3"
	
	> UInt32 "csBSelect0"
	> UInt32 "csBSelect1"
	> UInt32 "csBSelect2"
	> UInt32 "csBSelect3"
	
	> UInt32 "csCSelect0"
	> UInt32 "csCSelect1"
	> UInt32 "csCSelect2"
	> UInt32 "csCSelect3"
	
	> UInt32 "csDSelect0"
	> UInt32 "csDSelect1"
	> UInt32 "csDSelect2"
	> UInt32 "csDSelect3"
	
	> UInt16  "csDebug"
	> UInt8 "___filler2"[AE] \-
	typeend
	
	
typedef struct "HwrDBallPLLType"
	> UInt16 "pllControl"
	> UInt16 "pllFreqSel"
	> UInt16 "pllTest"
	> UInt8 "__filler44" \-
	> UInt8 "pwrControl"
	> UInt8 "___filler3"[F8] \-
	typeend
	
typedef struct "HwrDBallINTType"
	> UInt8 "intVector"
	> UInt8 "___filler4" \-
	> UInt16 "intControl"
	> UInt16 "intMaskHi"
	> UInt16 "intMaskLo"
	> UInt16 "intWakeupEnHi"
	> UInt16 "intWakeupEnLo"
	> UInt16 "intStatusHi"
	> UInt16 "intStatusLo"
	> UInt16 "intPendingHi"
	> UInt16 "intPendingLo"
	> UInt8 "___filler4a"[EC] \-
	typeend
	
	
typedef struct "HwrDBallPIOType"
	> UInt8 "portADir"
	> UInt8 "portAData"
	> UInt8 "___filler5" \-
	> UInt8 "portASelect"
	
	> UInt8 "___filler6"[4] \-
	
	> UInt8 "portBDir"
	> UInt8 "portBData"
	> UInt8 "___filler7" \-
	> UInt8 "portBSelect"
	
	> UInt8 "___filler8"[4] \-
	
	> UInt8 "portCDir"
	> UInt8 "portCData"
	> UInt8 "___filler9" \-
	> UInt8 "portCSelect"
	
	> UInt8 "___filler10"[4] \-
	
	> UInt8 "portDDir"
	> UInt8 "portDData"
	> UInt8 "portDPullupEn"
	> UInt8 "___filler11" \-
	> UInt8 "portDPolarity"
	> UInt8 "portDIntReqEn"
	> UInt8 "___filler12" \-
	> UInt8 "portDIntEdge"
	
	> UInt8 "portEDir"
	> UInt8 "portEData"
	> UInt8 "portEPullup"
	> UInt8 "portESelect"
	
	> UInt8 "___filler14"[4] \-
	
	> UInt8 "portFDir"
	> UInt8 "portFData"
	> UInt8 "portFPullup"  
	> UInt8 "portFSelect"
	
	> UInt8 "___filler16"[4] \-
	
	> UInt8 "portGDir"
	> UInt8 "portGData"
	> UInt8 "PortGPullup"
	> UInt8 "portGSelect"
	
	> UInt8 "___filler18"[4] \-
	
	> UInt8 "portJDir"
	> UInt8 "portJData"
	> UInt8 "___filler19"
	> UInt8 "portJSelect"
	
	> UInt8 "___filler19a"[4] \-
	
	> UInt8 "portKDir"
	> UInt8 "portKData"
	> UInt8 "portKPullup"
	> UInt8 "portKSelect"
	
	> UInt8 "___filler21"[4] \-
	
	> UInt8 "portMDir"
	> UInt8 "portMData"
	> UInt8 "portMPullupEn"
	> UInt8 "portMSelect"

	> UInt8 "___filler22"[4] \-
	
	> UInt8 "___filler23"[B0] \-
	typeend
	
	
typedef struct "HwrDBallPIODType"
	> UInt8 "portDDir"
	> UInt8 "portDData"
	> UInt8 "portDPullupEn"
	> UInt8 "___filler11" \-
	> UInt8 "portDPolarity"
	> UInt8 "portDIntReqEn"
	> UInt8 "___filler12" \-
	> UInt8 "portDIntEdge"
	typeend
	
	

typedef struct "HwrDBallPWMType"
	> UInt16 "pwmControl"
	> UInt16 "pwmPeriod"
	> UInt16 "pwmWidth"
	> UInt16 "pwmCounter"
	> UInt8 "___filler24"[F8] \-
	typeend
	
typedef struct "HwrDBallTimerType"
	> UInt16 "tmr1Control"
	> UInt16 "tmr1Prescaler"
	> UInt16 "tmr1Compare"
	> UInt16 "tmr1Capture"
	> UInt16 "tmr1Counter"
	> UInt16 "tmr1Status"
	
	> UInt16 "tmr2Control"
	> UInt16 "tmr2Prescaler"
	> UInt16 "tmr2Compare"
	> UInt16 "tmr2Capture"
	> UInt16 "tmr2Counter"
	> UInt16 "tmr2Status"

	> UInt16 "wdControl"
	> UInt16 "wdReference"
	> UInt16 "wdCounter"
	
	> UInt8 "___filler25"[E2] \-
	typeend	
	
	
typedef struct "HwrDBallWDType"
	> UInt16 "wdControl"
	> UInt16 "wdReference"
	> UInt16 "wdCounter"
	typeend	
		
typedef struct "HwrDBallSPIType"
	> UInt16 "spiSlave"
	
	> UInt8 "___filler26"[FE] \-
	
	> UInt16 "spiMasterData"
	> UInt16 "spiMasterControl"
	
	> UInt8 "___filler27"[FC] \-
	typeend
	
typedef struct "HwrDBallUARTType"
	> UInt16 "uControl"
	> UInt16 "uBaud"
	> UInt16 "uReceive"
	> UInt16 "uTransmit"
	> UInt16 "uMisc"
	> UInt8 "___filler28"[F6] \-
	typeend
	
typedef struct "HwrDBallLCDType"
	> UInt32 "lcdStartAddr"
	> UInt8 "___filler29" \-
	> UInt8 "lcdPageWidth"
	> UInt8 "___filler30"[2] \-
	> UInt16 "lcdScreenWidth"
	> UInt16 "lcdScreenHeight"
	> UInt8 "___filler31"[0C] \-
	> UInt16 "lcdCursorXPos"
	> UInt16 "lcdCursorYPos"
	> UInt16 "lcdCursorWidthHeight"
	> UInt8 "___filler32" \-
	> UInt8 "lcdBlinkControl"
	> UInt8 "lcdPanelControl"
	> UInt8 "lcdPolarity"
	> UInt8 "___filler33" \-
	> UInt8 "lcdACDRate"
	> UInt8 "___filler34" \-
	> UInt8 "lcdPixelClock"
	> UInt8 "___filler35" \-
	> UInt8 "lcdClockControl"
	> UInt8 "___filler36" \-
	> UInt8 "lcdLastBufferAddr"
	> UInt8 "___filler37" \-
	> UInt8 "lcdOctetTermCount"
	> UInt8 "___filler38" \-
	> UInt8 "lcdPanningOffset"
	> UInt8 "___filler39"[3] \-
	> UInt8 "lcdFrameRate"
	> UInt16 "lcdGrayPalette"
	> UInt8 "lcdReserved"
	> UInt8 "___filler40"[CA] \-
	typeend
	
typedef struct "HwrDBallRTCType"
	> UInt32 "rtcHourMinSec"
	> UInt32 "rtcAlarm"
	> UInt32 "rtcReserved"
	> UInt16 "rtcControl"
	> UInt16 "rtcIntStatus"
	> UInt16 "rtcIntEnable"
	> UInt16 "stopWatch"
	typeend
			
	
	
typedef struct "HwrDBallType"

	> UInt8 "scr"
	> UInt8 "___filler1"[FF] \-
	
	> HwrDBallCSType "Chip Select"
	

	> HwrDBallPLLType "PLL"
	
	
	> HwrDBallINTType "INT"
	
	
	> HwrDBallPIOType "PIO"
	
	
	> HwrDBallPWMType "PWM"
	
	
	> HwrDBallTimerType "Timer"
	
	
	> HwrDBallSPIType "SPI"
	
	
	> HwrDBallUARTType "UART"
	
	
	> HwrDBallLCDType "LCD"
		
	
	> HwrDBallRTCType "RTC"
	
	typeend
	

;################################################################
; Macros
;##############################################################
alias "DragonBall" 	"dm FFFFF000 HwrDBallType"
alias "DBCS" 			"dm FFFFF100 HwrDBallCSType"
alias "DBPLL" 			"dm FFFFF200 HwrDBallPLLType"
alias "DBINT" 			"dm FFFFF300 HwrDBallINTType"
alias "DBPIO" 			"dm FFFFF400 HwrDBallPIOType"
alias "DBKEYS" 		"dm FFFFF418 HwrDBallPIODType"
alias "DBPWM" 			"dm FFFFF500 HwrDBallPWMType"
alias "DBTimer" 		"dm FFFFF600 HwrDBallTimerType"
alias "DBSPI" 			"dm FFFFF700 HwrDBallSPIType"
alias "DBUART" 		"dm FFFFF900 HwrDBallUARTType"
alias "DBDUART" 		"dm hwrDuartBase M681DuartRead;\n"
alias "DBLCD" 			"dm FFFFFA00 HwrDBallLCDType"
alias "DBRTC" 			"dm FFFFFB00 HwrDBallRTCType"
